An existing encoding or decoding technology of video images includes an intra coding technology and an inter coding technology. The intra coding refers to a technology of compressing and encoding an image content merely by using a spatial correlation within an image that is being encoded currently. The inter coding refers to a technology of compressing and encoding a current image by using a temporal correlation between the image that is being encoded currently and an encoded image. In order to improve efficiency of image intra coding, the H.264/AVC (advanced video coding) standard first introduced an intra prediction technology to remove a spatial information redundancy between the image block that is being encoded currently and a neighboring encoded image block. As a result, unlike earlier intra coding technologies, H.264/AVC needs to perform spatial transformation and entropy encoding only on a prediction differential signal instead of an original image signal, so as to improve the intra coding efficiency.
A video image signal generally includes one luma component and two chroma components. The HEVC (high efficiency video coding) solution is a new generation video encoding standardized solution that the International Organization for Standardization is currently working on. It inherits the intra prediction encoding technology of the H.264/AVC standard, and introduces a new intra prediction mode, the LM mode, regarding the chroma components. When the LM mode is used, a chroma component predicted value of an image block is obtained by calculation using a linear model based on a reconstruction value of resampling a luma component of a corresponding block. Therefore, the LM mode is different from a conventional directional intra prediction mode. It uses a correlation between a luma component and a chroma component of an image, and is a method of predicting a chroma component value by using a luma component value.
The HEVC solution inherits and extends the intra prediction encoding technology in the H.264/AVC standard. All available intra prediction modes for chroma components of an image block form a prediction mode set, which includes the following six prediction modes:
DM mode: performs prediction by using an intra prediction mode of a luma component of a current block as a prediction mode of a chroma component;
LM mode: calculates a predicted value of a chroma component by using a value of a luma component of a sampling point based on a linear model, where a parameter of the linear model is obtained by calculation based on a luma component value and a chroma component value of a sampling point adjacent to a current block;
DC mode: uses an average value of chroma component values of a sampling point adjacent to a current block as a predicted value of a chroma component of the current block;
Planar mode: calculates a predicted value of a sampling point of a current block based on an assumption of a spatially linear smooth change in a value of the sampling point;
Horizontal mode: uses a chroma component value of an adjacent sampling point to the left as a predicted value of a chroma component of all sampling points within the same row of a current block; and
Vertical mode: uses a chroma component value of an adjacent above sampling point as a predicted value of a chroma component of all sampling points within the same column of a current block.
In a related technology, the foregoing chroma prediction modes use a TU (truncated unary) code solution to perform encoding or decoding, where the encoding or decoding are highly complex, and decoding efficiency is low.